package com.dyg.service.Impl;

import java.util.List;

import com.dyg.model.Resource;
import com.dyg.model.Role;
import com.dyg.dao.RoleMapper;
import com.dyg.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class RoleServiceImpl implements RoleService {

	@Autowired
	private RoleMapper roleMapper;

	@Override
	public void insertRole(Role role)	{
		this.roleMapper.insertRole(role);
	}

	@Override
	public void deleteRoleById(String roleId)	{
		this.roleMapper.deleteRoleById(roleId);
	}

	@Override
	public void updateRole(Role role)	{
		this.roleMapper.updateRole(role);
	}

	@Override
	public Role findRoleById(String roleId)	{
		return this.roleMapper.findRoleById(roleId);
	}

	@Override
	public List<Role> findRoleList()	{
		return this.roleMapper.findRoleList();
	}

	/**
     * 查询指定用户所指定的角色字符串列表
     * @param uid
     * @return
     */
	@Override
	public List<String> listRoleSnByUser(int userId) {
		
		return roleMapper.listRoleSnByUser(userId);
	}

}
